package DateTimeFormatter1;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class Dame1 {
    public static void main(String[] args) {
        String s ="2020-10-8 14:31:38";
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-d HH:mm:ss");
        LocalDateTime parse = LocalDateTime.parse(s, dateTimeFormatter);
        System.out.println(parse);
    }

    private static void mothod() {
        LocalDateTime localDateTime = LocalDateTime.of(2020, 11, 9, 14, 28, 14);
        System.out.println(localDateTime);

        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH-mm-ss");
        String s = localDateTime.format(dateTimeFormatter);
        System.out.println(s);
    }
}
